Determining
a Compressor s Output Format
The following
example uses the ICCompressGetFormat
LPBITMAPINFOHEADER lpbiIn,
lpbiOut;
// *lpbiIn must be initialized to the input format.
dwFormatSize = ICCompressGetFormatSize(hIC, lpbiIn);
h = GlobalAlloc(GHND, dwFormatSize);
lpbiOut = (LPBITMAPINFOHEADER)GlobalLock(h);
ICCompressGetFormat(hIC, lpbiIn, lpbiOut);
The following
example uses the ICCompressQuery
LPBITMAPINFOHEADER lpbiIn,
lpbiOut;
// Both *lpbiIn and *lpbiOut must be initialized to
the respective
// formats.
if (ICCompressQuery(hIC, lpbiIn, lpbiOut) ==
ICERR_OK)
{
// Format
is supported; use the compressor.
}
The following
example uses the ICCompressGetSize
// Find the worst-case buffer size.
dwCompressBufferSize = ICCompressGetSize(hIC,
lpbiIn, lpbiOut);
// Allocate a buffer and get lpOutput to point to
it.
h = GlobalAlloc(GHND, dwCompressBufferSize);
lpOutput = (LPVOID)GlobalLock(h);